<?php
	require '../../feed/config/config.php';
	session_start();
	$ConnfigRs=mysqli_fetch_array(mysqli_query($con,"select * from config where id='1'"));
	if(empty($_SESSION['member'])){
	    echo "<script>location='../index.php';</script>";
	}
	if(empty($_GET['clubId'])){
	    echo "<script>location='../index.php';</script>";
	}
	if($_GET['ops']=="logout"){
	    session_destroy();
	    session_start();
	    $_SESSION['url']="https://edu.yudur.cn/index/index.php";
	    echo "<script>alert('您已成功退出');location='../index.php';</script>";
	}
	if($_POST['submit']){
	    if(empty($_GET['clubId'])){
            echo "<script>location='../index.php';</script>";
        }else{
            $addRs=mysqli_query($con,"INSERT INTO `activity` (`id`,`name`,`more`,`addTime`,`startTime`,`overTime`,`addUser`,`clubId`,`online`,`other`,`state`) VALUES ('','".$_POST['name']."','".$_POST['more']."','".date("Y/m/d H:i:s")."','".$_POST['startTime']."','".$_POST['overTime']."','".$_SESSION['member']."','".$_GET['clubId']."','".$_POST['online']."','".$_POST['other']."','0')");
            if($addRs){
                echo "<script>alert('活动已经成功发布！');location='./index.php';</script>";
            }else{
                echo "<script>alert('系统异常，发布失败！');history.back();</script>";
            }
        }
	}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"/>
    <title>活动中心 - 新建活动</title>
    <script type="text/javascript" src="../js/base-loading.min.js"></script>
    <script type="text/javascript" src="../js/layui.js"></script>
    <link rel="stylesheet" href="../css/style.css"/>
    <link rel="stylesheet" href="../css/layui.css"/>
    <style>
    .cen_one{
        height: 500px;
    }
    .cen_one_fl{
        height: 480px;
    }
    .mF_liuzg{
        height: 400px;
        width: 500px;
        text-align: left;
        margin-left: -140px;
    }
    </style>
  </head>
  <body>
    <div class="s_header w">
      <div class="s_header_top w">
        <div class="header_top w1000 auto">
          <div class="header_top_fl fl">欢迎访问<?php echo $ConnfigRs['name'];?></div>
          <div class="header_top_fr fr"><span class="header_email dib"></span><span class="header_tel dib"></span>
            <div class="cb"></div>
          </div>
          <div class="cb"></div>
        </div>
      </div>
      <div class="s_header_nav w">
        <div class="header_nav w1000 auto">
          <div class="logo fl"><a href="index.html"><img src="http://www.huayu.edu.cn/template/huayu/listimages/logo.png" alt=""/></a></div>
        </div>
      </div>
    </div>
    <div class="banner">
      <div id="banner" class="dv_5"><a href="" style=" background:url(../images/hy.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner2.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner3.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a>
      </div>
    </div>
    <div class="s_cen w">
      <div class="center w1000 auto">
        <br />
        <p><a href="../index.php">首页</a> / <a href="./index.php">活动中心</a> / 新建活动</p>
        <br />
        <form method="post" action="./addaction.php?clubId=<?php echo $_GET['clubId'];?>" class="layui-form">
            <input type="text" name="name" placeholder="请输入活动名称" class="layui-input"><br /><br />
            <textarea name="more" placeholder="请输入活动介绍" class="layui-textarea"></textarea><br /><br />
            <input type="date" name="startTime" class="layui-input" placeholder="请选择活动开始时间"><br /><br />
            <input type="date" name="overTime" class="layui-input" placeholder="请选择活动结束时间"><br /><br />
            <select name="online" class="layui-input">
                <option selected hidden disabled value="">请选择是否需要在线报名</option>
                <option value="1">需要</option>
                <option value="0">不需要</option>
            </select><br /><br />
            <select name="other" class="layui-input">
                <option selected hidden disabled value="">请选择是否需要在线提交附件（仅限开启在线报名）</option>
                <option value="1">需要</option>
                <option value="0">不需要</option>
            </select><br /><br />
            <input type="submit" name="submit" class="layui-btn" value="提交"><br /><br />
        </form>
      </div>
    </div>
    <div class="s_footer w">
      <div class="footer w1000 auto">
        <div class="footer_fl fl">
          <div class="footer_logo"><a href=""><img src="http://www.huayu.edu.cn/template/huayu/images/logo.png"  alt="" width="100%"/></a></div>
          <div class="footer_line"></div>
          <div class="footer_fl_ul">
            
          </div>
          <div class="cb"></div>
          <div class="footer_fl_record"></div>
        </div>
        <div class="footer_fr fr">
          <div class="footer_fr_top"></div>
          <div class="footer_line"></div>
         
          <div class="footer_from">｜<a href="" target="_blank">XXX</a></div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="../js/jquery-1.8.1.min.js"></script>
    <!--首页banner特效-->
    <script type="text/javascript" src="../js/banner.js"></script>
    <script type="text/javascript" src="../js/main.js"> </script>
    <script type="text/javascript" src="../js/jquery.SuperSlide.2.1.1.js"></script>
</body>
</html>